#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	vector<int> q;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		q.push_back(a);
	}
	sort(q.begin(), q.end());
	q.erase(unique(q.begin(), q.end()), q.end());
	cout << q.size() << endl;
	for (int a : q) {
		cout << a << ' ';
	}
	return 0;
}